package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.modeler.model.core.MetaModelElement;
import edu.pku.sei.transformation.editor.model.test.CheckPoint;
import edu.pku.sei.transformation.editor.model.test.CheckPointOperand;

public class CheckPointOperandDeleteCommand extends
		AbstractLinkDeleteCommand<CheckPointOperand, CheckPoint, MetaModelElement> {

	public CheckPointOperandDeleteCommand(CheckPointOperand link, CheckPoint source, MetaModelElement target) {
		super(link, source, target);
		setLabel("delete CheckPoint Operand");
	}
	
	@Override
	public void undo() {
		link.setCheckPoint(source);
		link.setOperand(target);
		source.addOperand(link);
	}
	
	@Override
	public void execute() {
		link.setCheckPoint(null);
		link.setOperand(null);
		source.removeOperand(link);
	}
}
